﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Main_Othello_Game
{
    public partial class FormResult : Form
    {
        #region 定数
        //各画面に割り振られている番号
        private const int MAINSCREEN = 1;
        private const int CONNECTSCREEN = 2;
        private const int PLAYSCREEN = 3;
        private const int RESULTSCREEN = 4;
        #endregion

        //勝敗結果用変数宣言
        long Res;

        public long Result
        {
            set { Res = value; }
            get { return Res; }
        }

        public FormResult(long lResult)
        {
            //勝敗結果
            Res = lResult;

            InitializeComponent();
        }

        private void FormResult_Load(object sender, EventArgs e)
        {
            //勝敗メッセージ設定
            const string WINNER = "You are Winner!!";
            const string LOSER = "You are Loser...";
            const string DRAW = "Draw Match";

            //勝敗結果で出力するメッセージを設定
            switch (Res)
            {
                case 0:
                    this.LabelResult.Text = DRAW;
                    break;
                case 1:
                    this.LabelResult.Text = WINNER;
                    break;
                case 2:
                    this.LabelResult.Text = LOSER;
                    break;
            }
        }

        private void ReturnButton_Click(object sender, EventArgs e)
        {
            //画面遷移(メイン画面)
            Program.FormContainer.Change(MAINSCREEN);
        }
    }
}
